#!/bin/bash
#1 获取输入参数个数，如果没有参数，直接退出
FILE_COUNT=$#
if((FILE_COUNT==0)); then
    echo ">>> 错误：未传递文件参数！"
    echo "  用法：mssql_docker.sh rootPassword"
    exit;
fi
ROOT_PASSWORD=$1


docker run -d \
    --privileged=true \
    -v /etc/localtime:/etc/localtime:ro \
    -p 1433:1433 \
    -e SA_PASSWORD=$ROOT_PASSWORD \
    -e ACCEPT_EULA=Y \
    -v /opt/module/mssql/data/:/var/opt/mssql/data/ \
    --name mssql \
    docker.io/microsoft/mssql-server-linux


# ============= 本容器提供如下安装信息:============= 
# username：sa
# password：123456
# port：1433
# ============== jdbc依赖 ==============
# <dependency>
#     <groupId>com.microsoft.sqlserver</groupId>
#     <artifactId>mssql-jdbc</artifactId>
#     <version>11.2.0.3</version>
# </dependency>
#=============== url连接 ===============
# jdbc:sqlserver://${host}:${port};${dbName}